from sympy.abc import x, y, z
mass2d = [
        [240, 288, 192, 320, 384, 256, z, 216, x],
        [240, 288, 192, 320, 384, 256, 360, z, x],
        ]
from sympy import *

def get_a0(n):
    lst = []
    a2 = [i.copy() for i in mass2d]
    for i in a2:
        if str(i[n]).isdigit():
            i[n] = y
            m0 = Matrix(3,3,i)
            md0 = m0.det()
            if md0 ==0:
                lst.append(m0.values())
    return lst

def get_a3():
    lst = []
    for i in range(9):
        lst.extend(get_a0(i))
    print(lst)

get_a3()
